<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="en">
<head>    
<meta charset="utf-8">    
<title>码狗</title>    
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0">    

</head>    

<script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script>
<body>
			<input id = "code"  style=" width: 218px;height: 74px; font-size: 23px;"type = "text" name="active" placeholder="请输入激活码">
			<button style=" width: 125px;height: 80px; font-size: 23px;" onclick="check()" value="确定" name="确定">确定</button> 
			<p style="    position: absolute;left: 91px;">温馨提示：激活码藏在包装盒盖子里</p>
</body>
<script>
	
	function check(){
		
		var code = $("#code").val();
		$.get("/codedog/f/checkCode",
			    {
						activationCode: code,
						giftNo : '${giftNo}'
			    },
			    function(data,status){
			    	
			    	if(code == ''){
						alert("请输入激活码");
			    	}else{
						if(data.error.errCode == 1){
							alert("不存在该激活码");
						}else{		
							alert("激活码有效");
							window.location.href="/codedog/f/record?giftNo="+'${giftNo}'+"&activationCode="+code;
						}			    		
			    	}
			    	
				});  		
	}

</script>
</html>